package com.iflytek.edu.common.base;

/**
 * 返回Json实体类
 */
public class BaseResponse {

    private int code;
    private String msg;
    private Object data;

    public BaseResponse() {
    }

    public BaseResponse(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static BaseResponse success(String content) {
        return new BaseResponse(0, content, null);
    }

    public static BaseResponse success(String content, Object data) {
        return new BaseResponse(0, content, data);
    }

    public static BaseResponse error(int code, String content) {
        return new BaseResponse(code, content, null);
    }

    public static BaseResponse error(String content) {
        return new BaseResponse(1, content, null);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
